package edu.gatech.cs2340.sharks.fms;

/**
 * HomeActivity.java
 * @author Monica Shum
 * 
 * Presents the user with a list of potential actions after they log in
 */

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import edu.gatech.cs2340.sharks.fms.data.*;

public class HomeActivity extends Activity
{
	/**
	 * The current instance of the activity, used to make sure there is only one instance of this activity running at a time.
	 */
	private static Activity instance = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState); 
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_user_home);
		if (instance != null) instance.finish();
		instance = this;
	}
	
	public void lostItems(View view)
	{
		Intent viewLost = new Intent(this, LostItemsActivity.class);
		startActivity(viewLost);
	}
	
	public void foundItems(View view)
	{
		Intent viewFound = new Intent(this, FoundItemsActivity.class);
		startActivity(viewFound); 
	}
	
	public void logout(View view)
	{
		DBMgr.logout(DBMgr.user); 
		finish(); 
	}
	
	public void searchItem(View view)
	{
		Intent toSearchItem = new Intent(this, FilterSearchActivity.class);
		startActivity(toSearchItem);
	}

}